import { Link, useNavigate } from "react-router-dom";

const Login = () => {
  const navigate = useNavigate();
  return (
    <div className="">
      <div>Login</div>
      {/* 声明式导航 */}
      <Link to={"/user"}>User</Link>
      {/* 编程式导航 */}
      <button onClick={() => navigate("/user")}>去User</button>
      {/* searchParams传参 */}
      <button onClick={() => navigate("/user?id=123&name=xxx")}>去User</button>
      {/* params传参 */}
      <button onClick={() => navigate("/user/123/name")}>去User</button>
    </div>
  );
};

export default Login;
